#pragma once

#include<iostream>
#include<deque>
using namespace std;

namespace my
{
	template<class T, class container = deque<T>>
	class queue
	{
	public:
		queue(container ctnr = container())
			:_con(ctnr)
		{}

		bool empty() const
		{
			return _con.empty();
		}

		size_t size() const
		{
			return _con.size();
		}

		T& front()
		{
			return _con.front();
		}

		const T& front() const
		{
			return _con.front();
		}

		T& back()
		{
			return _con.back();
		}

		const T& back() const
		{
			return _con.back();
		}

		void push(const T& val)
		{
			_con.push_back(val);
		}

		void pop()
		{
			_con.pop_front();
		}

	private:
		container _con;
	};

	void Test_queue()
	{
		queue<int> q;
		q.push(1);
		q.push(2);
		q.push(3);
		q.push(4);
		cout << q.front() << ' ' << q.back() << endl;
		q.pop();
		q.pop();
		cout << q.front() << ' ' << q.back() << endl;
		cout << q.empty() << endl;
		cout << q.size() << endl;
	}
}